package com.xixisleep.yeapiclientsdk;

import com.xixisleep.yeapiclientsdk.client.YeApiClient;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConfigurationProperties("yeapi.client")
@Data
@ComponentScan
public class YeApiClientConfig {

    private String accessKey;

    private String secretKey;

    //创建一个名为 “yeApiClient”的 Bean
    @Bean
    public YeApiClient yeApiClient(){
        //使用accessKey，secretKey创建一个YeApiClient实例
        return new YeApiClient(accessKey,secretKey);
    }
}
